package team.first.movieapiv3pro.movie;

import lombok.Getter;
import lombok.Setter;
import lombok.ToString;
import lombok.experimental.Accessors;
import org.neo4j.ogm.annotation.Id;
import org.neo4j.ogm.annotation.NodeEntity;
import org.neo4j.ogm.annotation.Relationship;

import java.util.ArrayList;
import java.util.List;

@Getter
@Setter
@ToString
@Accessors(chain = true)
@NodeEntity(label = "Movie")
public class MovieNode {

    @Id
    private Integer id;
    private String originalTitle;
    private String chineseTitle;
    private String aka;
    private Integer year;
    private String region;
    private String duration;
    private String language;
    private String pubDate;
    private String summary;
    private String posterUrl;
    private Double rating;
    private String poster;

    // 设置关联属性，关系为 HAS_GENRE， 单向箭头从本节点指出
    @Relationship(type = "HAS_GENRE")
    private List<GenreNode> genres = new ArrayList<>();

    @Relationship(type = "ACTED", direction = Relationship.INCOMING)
    private List<Cast> actors = new ArrayList<>();

    @Relationship(type = "DIRECTED", direction = Relationship.INCOMING)
    private List<Cast> directors = new ArrayList<>();


}
